package org.lds.scheduled.job.admin.client.autoconfigure;

import lombok.RequiredArgsConstructor;
import org.lds.scheduled.job.admin.client.AdminClient;
import org.lds.scheduled.job.admin.client.endpoint.HealthEndpoint;
import org.lds.scheduled.job.admin.client.properties.AdminClientProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@RequiredArgsConstructor
@Configuration
@EnableConfigurationProperties({AdminClientProperties.class})
public class AdminClientAutoConfiguration {
    private final AdminClientProperties adminClientProperties;

    @Bean
    public AdminClient adminClient() {
        return new AdminClient(adminClientProperties);
    }

    @Bean
    public HealthEndpoint adminClientHealthEndpoint() {
        return new HealthEndpoint();
    }

}
